<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>

  <div id="app"></div>
  <script>

    var common = {
      data: {
        islogin: true,
        name: 'common name'
      },
      created() {
        console.log('created')
      },
      methods: {
        getMsg() {
          return 'hello world'
        }
      }
    }

    var vm = new Vue({
      mixins: [common],
      el: "#app",
      data: {
        name: 'xiaoming'
      },
      created() {
        console.log('root created')
      },
      methods: {
        getMsg() {
          return 'root msg'
        }
      },
      mounted() {
        console.log(this.islogin)
        console.log(this.getMsg())
      }
    })
  </script>

</body>

</html>